package com.pengshun.modules.api.user.repository;

import com.pengshun.modules.domain.SystemMessage;
import com.pengshun.modules.domain.SystemMessageUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;


public interface SystemMessageUserRepository extends JpaRepository<SystemMessageUser, Long>, JpaSpecificationExecutor<SystemMessageUser> {
    /**
     * 删除已读
     * @param systemMessageId
     * @return
     */
    int deleteBySystemMessageId(Long systemMessageId);

    /**
     * 根据用户id 和消息id查询
     * @param userId
     * @param systemMessageId
     * @return
     */
    SystemMessageUser findByUserIdAndSystemMessageId(Long userId ,Long systemMessageId);

}
